{extend name="common:base" /}
{block name="body"}
<div class="x-nav">
    <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">语言管理</a>
        <a>
            <cite>语言列表</cite></a>
    </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
        onclick="location.reload()" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">
                    <button class="layui-btn" onclick="xadmin.open('添加','{:url(\'add_language\')}',600,360)"><i
                            class="layui-icon"></i>添加
                    </button>
                </div>
                <div class="layui-card-body layui-table-body layui-table-main">
                    <table class="layui-table layui-form">
                        <colgroup>
                            <!--                            <col width="80">-->
                            <col width="120">
                            <col width="120">
                            <col>
                            <col width="120">
                            <col width="20">
                            <col>
                        </colgroup>
                        <thead>
                            <tr class="text-center">
                                <!--<th>
                                <input type="checkbox" lay-filter="checkall" name="" lay-skin="primary">
                            </th>-->
                                <th>语种</th>
                                <th>标识（code）</th>
                                <th>描述（description）</th>
                                <th>更新时间</th>
                                <th>状态</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            {notempty name="data.data"}
                            {volist name="data.data" id="vo"}
                            <tr>
                                <!--                            <td>{$vo.id}</td>-->
                                <td>{$vo.name}</td>
                                <td>{$vo.code}</td>
                                <td>{$vo.remark}</td>
                                <td>{$vo.update_time|date='Y-m-d'}</td>
                                <td class="td-status">
                                    {if($vo.status == 1)}
                                    <button class="layui-btn layui-btn-normal layui-btn-mini">启用</button>
                                    {else /}
                                    <button class="layui-btn layui-btn-danger layui-btn-mini">禁用</button>
                                    {/if}
                                </td>
                                <td class="td-manage">
                                    <a title="编辑"
                                        onclick="xadmin.open('编辑','{:url(\'edit_language\',[\'id\'=>$vo.id])}',600,400)"
                                        href="javascript:;" class="layui-btn">
                                        <i class="layui-icon" style="font-size: 22px">&#xe642;</i>
                                    </a>
                                    {if($vo.status == 2)}
                                    <button class="layui-btn layui-btn-normal layui-btn-mini"
                                        onclick="changeStatus('{:url(\'change_language_status\',[\'id\'=>$vo.id,\'status\'=>1])}')">启用</button>
                                    {else /}
                                    <button class="layui-btn layui-btn-danger layui-btn-mini"
                                        onclick="changeStatus('{:url(\'change_language_status\',[\'id\'=>$vo.id,\'status\'=>2])}')">禁用</button>
                                    {/if}
                                    <!--<a title="删除" onclick="changeStatus(this,'要删除的id')" href="javascript:;" class="layui-btn layui-btn-danger">
                                    <i class="layui-icon" style="font-size: 22px">&#xe640;</i>
                                </a>-->
                                </td>
                            </tr>
                            {/volist}
                            {/notempty}
                        </tbody>
                    </table>
                </div>
                <div class="layui-card-body ">
                    <div id="page" class="page"></div>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="javascript"}
<script src="{{admin}}/js/common.js"></script>
<script>
    layui.use(['laypage'], function () {
        var laypage = layui.laypage;
        laypage.render({
            elem: 'page',
            count: '{$data.total}',
            limit: '{$data.per_page}',
            curr: '{$data.current_page}',
            jump: function (obj, first) {
                if (!first) {
                    location.href = '?page=' + obj.curr;
                }
            }
        });
    });
</script>
{/block}